package com.aspose.cells;

import java.util.ArrayList;

class zbbq {
   private zcfx a;
   private Worksheet b;
   private Workbook c;

   zbbq(zcfx var1, Worksheet var2, Workbook var3) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
   }

   void a() throws Exception {
      if (this.b.getConditionalFormattings() != null) {
         zcfx var1 = this.a;

         for(int var2 = 0; var2 < this.b.getConditionalFormattings().getCount(); ++var2) {
            FormatConditionCollection var3 = this.b.getConditionalFormattings().get(var2);
            var1.b("x:ConditionalFormatting");
            if (var3.b != null || var3.getCount() != 0) {
               String var4 = zase.a((ArrayList)var3.b, 0, (int)var3.b.size());
               var1.b("x:Range", var4);
               int[] var7 = var3.e();
               int var5 = var7[0];
               int var6 = var7[1];

               for(int var8 = 0; var8 < var3.getCount(); ++var8) {
                  FormatCondition var9 = var3.get(var8);
                  this.a(var1, var9, var5, var6);
               }

               var1.b();
            }
         }

      }
   }

   void a(zcfx var1, FormatCondition var2, int var3, int var4) throws Exception {
      var1.b("x:Condition");
      if (var2.getType() == 0 && var2.b != 6) {
         String var5 = zbbx.a(var2.b);
         var1.b("x:Qualifier", var5);
      }

      var1.b("x:Value1");
      String[] var8 = zasp.a(var2);
      String var6 = var8[0];
      var1.a(zase.H(var6));
      var1.b();
      if (var2.b == 0 || var2.b == 7) {
         var1.b("x:Value2");
         var6 = var8[1];
         var1.a(zase.H(var6));
         var1.b();
      }

      String var7 = this.a(var2);
      var1.b("x:Format");
      var1.a("Style", var7);
      var1.b();
      var1.b();
   }

   String a(FormatCondition var1) {
      Style var2 = var1.getStyle();
      String var3 = this.a(var2);
      String var4 = this.b(var2);
      String var5 = this.c(var2);
      String var6 = var3 + var4 + var5;
      if (var6.endsWith(";")) {
         var6 = var6.substring(0, 0 + (var6.length() - 1));
      }

      return var6;
   }

   String a(Style var1) {
      if (!var1.isModified(11)) {
         return "";
      } else {
         Font var2 = var1.getFont();
         StringBuilder var3 = new StringBuilder(100);
         if (var1.isModified(16)) {
            if (var2.b.a()) {
               var3.append("color:windowtext;");
            } else {
               var3.append("color:#" + zase.a(var2.getColor()) + ";");
            }
         }

         if (var2.isItalic()) {
            var3.append("font-style:italic;");
         }

         if (var1.isModified(17)) {
            if (var2.isBold()) {
               var3.append("font-weight:700;");
            } else {
               var3.append("font-weight:400;");
            }
         }

         if (var1.isModified(19)) {
            String var4 = zbbx.b(var2.getUnderline());
            var3.append("text-underline-style:" + var4 + ";");
         }

         if (var1.isModified(20)) {
            if (var2.isStrikeout()) {
               var3.append("text-line-through:single;");
            } else {
               var3.append("text-line-through:none;");
            }
         }

         return com.aspose.cells.b.a.zr.a(var3);
      }
   }

   String b(Style var1) {
      if (!var1.isModified(1)) {
         return "";
      } else {
         StringBuilder var2 = new StringBuilder(100);
         if (var1.f()) {
            var2.append("border-top:" + zbbx.a(var1, 4) + ";");
            var2.append("border-right:" + zbbx.a(var1, 2) + ";");
            var2.append("border-bottom:" + zbbx.a(var1, 8) + ";");
            var2.append("border-left:" + zbbx.a(var1, 1) + ";");
         } else {
            var2.append("border:none;");
         }

         return com.aspose.cells.b.a.zr.a(var2);
      }
   }

   String c(Style var1) {
      return !var1.isModified(33) && !var1.isModified(35) && !var1.isModified(34) ? "" : zbbx.a(var1);
   }
}
